from sqlalchemy import Column, Integer, String
from database import Base


# 创建一个类继承Base基类
class Host(Base):
    # 表名为hosts
    __tablename__ = 'hosts'
    # 表结构
    # primary_key等于主键
    # unique唯一
    # nullable非空
    id = Column(Integer, primary_key=True, autoincrement=True)
    hostname = Column(String(64), unique=True, nullable=False)
    ip_addr = Column(String(128), unique=True, nullable=False)
    port = Column(Integer, default=22)
